#ifndef IMPORT_H__
#define IMPORT_H__

#include "basic.h"

#if 0
import basic;
#endif

// TODO Consider adding support for more importing styles:

// CURRENTLY SUPPORTED
// import a;
// import a.b;

// MAY WANT TO SUPPORT
// import a.*;
// from a import b;
// from a.b import c;
// from a import *;
// from a.b import *;
// import a as b;
// import a.b as c;
// from a import b as c;
// from a.b import c as d;

struct Import
{
	struct NameList* path;
};

struct Import* allocateImport(struct NameList* path)
{
	struct Import* r = malloc(sizeof(struct Import));
	r->path = path;
	return r;
}

void freeImport(struct Import* f)
{
	if(f == NULL) return;
	freeNameList(f->path);
	free(f);
}

struct ImportList
{
	struct Import* head;
	struct ImportList* tail;
};

struct ImportList* allocateImportList(
	struct Import* head,
	struct ImportList* tail)
{
	assert(head != NULL);

	struct ImportList* r = malloc(sizeof(struct ImportList));
	r->head = head;
	r->tail = tail;
	return r;
}

void freeImportList(struct ImportList* f)
{
	if(f == NULL) return;
	freeImport(f->head);
	freeImportList(f->tail);
	free(f);
}

#endif
